package com.supcon.exchangedata.repository.master;

import com.supcon.exchangedata.pojo.entity.oracle.BaseGeoArea;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @program: exchange-data
 * @description:
 * @author: cherubr.Sumin
 * @create: 2021-12-15 14:24
 **/
public interface MasterBaseAreaRepository extends JpaRepository<BaseGeoArea, Long>,MasterBusRoutesStationRepository {

    /**
     * 根据areaType查找
     * @param areaType
     * @return
     */
    public List<BaseGeoArea> findBaseGeoAreaByAreaType(Long areaType);
    public BaseGeoArea findBaseGeoAreasByAreaCode(Long areaCode);

    public BaseGeoArea findBaseGeoAreaByAreaCodeAndAreaType(Long areaCode,Long areaType);

    @Transactional
    int deleteBaseGeoAreaByAreaType(Long areaType);

    public Long countAllByAreaType(Long areaType);

    public List<BaseGeoArea> findByAreaType(Long areaType);
}
